fix(ci): parse single-equals interrogate section headers#1704
Open
Thabhelo wants to merge 2 commits into
Open
Conversation
Interrogate 1.7 prints "= Coverage for ... =" headers, but the docstring coverage checker only matched 4+ equals signs. That left current_dir empty, produced wrong file paths, and falsely flagged baseline grandfathered items as new undocumented symbols when example files were edited. Signed-off-by: Thabhelo <50872400+Thabhelo@users.noreply.github.com>
3 tasks
Contributor
Greptile SummaryThis PR fixes a false-positive in the docstring-coverage pre-commit hook by broadening the interrogate output parser to accept section headers that use any number of equals signs, including the single-
Important Files Changed
Reviews (1): Last reviewed commit: "fix(ci): parse single-equals interrogate..." | Re-trigger Greptile |
Add test/ci_tests/conftest.py so the bare-module import in test_check_docstring_coverage.py stays reliable across pytest import modes. Signed-off-by: Thabhelo <50872400+Thabhelo@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
check_docstring_coverage.pyto accept section headers with any number of equals signs (including the single-=format used by interrogate 1.7).Related context: #1703 added docstrings on a few crash example symbols because the hook falsely reported baseline-grandfathered items as new when editing example files. This PR fixes that root cause.
Test plan
pytest test/ci_tests/test_check_docstring_coverage.pypython test/ci_tests/check_docstring_coverage.py examples/structural_mechanics/crash/datapipe.py examples/structural_mechanics/crash/train.py(passes with baseline-only gaps, no false positives)